<div>

    <form id="migration" action="{:url('verify')}" method="post" class="form-horizontal ajax-form">
        <input type="hidden" name="id" value="{$id}">


        <div class="form-group">
            <label class="col-sm-3">状态</label>
            <div class="col-sm-9">
                <div class="" style="padding-top:7px">
                    <input type="radio" name="status" id="is_status-1" value="1" checked> 
                    <label class="radio-inline" for="is_status-1"> 通过审核</label>
                    <input type="radio" name="status" id="is_status--2" value="-2">
                    <label class="radio-inline" for="is_status--2"> 拒绝通过</label>
                </div>
            </div>
        </div>

        <div class="form-group hidden" id="reasonArea">
            <label class="col-xs-3 control-label">
                审核失败原因：
            </label>
            <div class="col-xs-9">
                <textarea name="reason" class="form-control" rows="3" placeholder="请填写审核失败原因，方便投稿人对应修改~（限100字,超过部分会被过滤）"></textarea>
                <div class="clearfix"></div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-xs-3 control-label">
                
            </label>
            <div class="col-xs-9">
                <a class="btn btn-primary" data-role="submit">提交</a>
                <a onclick="$('.close').click();" class="btn btn-default">取消</a>
            </div>
        </div>
    </form>
</div>
<script>
    $(function(){
        $("input[type='radio']").on("click",function () {
            if($("input[id='is_status--2']:checked").val()=="-2"){
                $('#reasonArea').removeClass('hidden');
            }else{
                $('#reasonArea').addClass('hidden');
            }
        })
    });

    $(function(){
        $('[data-role="submit"]').click(function(){
            query=$('#migration').serialize();
            var url=$('#migration').attr('action');
            $.post(url,query,function(res){
                if(res.code == 200){
                    toast.success('操作成功！');
                    setTimeout(function(){
                        window.location.href=res.url;
                    },1500);
                }else{
                    handleAjax(res);
                }
            },'json');
        });
    });
</script>